<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        var num = 2; //Number 
        var str = "你好" //String
        var numStr = "2"; //String
        var status = true; 
        console.log(str)
        var a;
        a = 2;
        a += 2;
        console.log(a)
        console.log(false == 0) //true
        console.log(true == 1) //true
        console.log( 1 == "1") //true false
        //数组
        //var arr = new Array();
        var arr = [{name:"李四",age:"30"},2,3,45,5]; 
        // console.log(arr)
        // console.log(arr.length)
        // console.log(arr[arr.length - 1]);
        for(var i =0;i < arr.length;i++){
            //console.log(i)
            var ele = arr[i];
            console.log(ele);
        }
        //面向对象开发
        var obj = new Object();
       // var obj = {};
        obj.name = "张三";
        obj.age = "25";
        // obj.children = {
        //     name:"张三儿子",
        //     age:"5"
        // },
        obj.children = [
            {
                name:""
            }
        ]
        console.log(obj);
        //字符串拼接
        var str = "你好";
        var strlast = str+"订"+str+"单"+str;
        console.log(strlast);//box bax bcx
        var elc = "a"
        var el = "<div class='b"+elc+"x'></div>"
        console.log(el);
        var numa = 1;
        var numb = undefined;
        console.log(numa + numb)
        var status = numa == 2 ? (numb == undefined ? 1 : 2) : 3;

    </script>
</body>
</html>